package com.coco.seck.controller;

import com.coco.common.annotation.IngoreResponseAdvice;
import com.coco.seck.pojo.TbSeckillOrder;
import com.coco.seck.service.SeckOrderService;
import com.coco.seck.vo.SeckOrderGoods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author HanSama
 * @date 2021年07月20日 21:27
 */
@RestController
@RequestMapping("/seck/order")
public class SeckOrderController {

    @Autowired
    private SeckOrderService seckOrderService;

    @GetMapping("/findOneById")
    public TbSeckillOrder findOneById(@RequestParam("id") Long id){
        return seckOrderService.findOneById(id);
    }

    @GetMapping("/findAliPayOrder")
    @IngoreResponseAdvice
    public SeckOrderGoods findAliPayOrder(@RequestParam("id") Long id){
        return seckOrderService.findAliPayOrder(id);
    }

    @GetMapping("/updateStatus")
    public void updateStatus(@RequestParam("id") Long id,@RequestParam("status") Integer status){
        seckOrderService.updateStatus(id,status);
    }
}
